package net.ikenna.yadet;

import org.dbunit.database.*;
import org.dbunit.dataset.*;
import org.dbunit.dataset.xml.*;

import java.io.*;
import java.sql.*;

public class XmlDataExtractor {

    public static void main(String[] args) throws Exception {
        Connection jdbcConnection = DriverManager.getConnection("jdbc:h2:~/test", "sa", "");
        IDataSet fullDataSet = new DatabaseConnection(jdbcConnection).createDataSet();
        FlatXmlDataSet.write(fullDataSet, new FileOutputStream("dataset.xml"));
    }

}
